Image processing device, image processing method, and non-transitory recording medium

ABSTRACT

The binary processor of a digital camera turns an image targeted to recognize a particular shape into a binary image. The searcher searches for a valid pixel that is a pixel satisfying a given condition from the binary image. The determiner determines whether the region comprising a set of valid pixels has a particular shape when it is determined that a valid pixel is detected during the search. The retainer retains position information showing the position of the region comprising the set of valid pixels and determined to have the particular shape when the determiner determines that the region has the particular shape.

CROSS-REFERENCE TO RELATED APPLICATION

This application claims the benefit of Japanese Patent Application No.2013-163659, filed on Aug. 6, 2013, the entire disclosure of which isincorporated by reference herein.

FIELD

This application relates to an image processing device, image processingmethod, and non-transitory recording medium.

BACKGROUND

Various techniques for recognizing a given shape contained in an imageare known in the prior art.

For example, the Hough conversion is generally known as a technique forrecognizing a geometric shape (such as a circle) in an image.

On the other hand, as described in Unexamined Japanese PatentApplication Kokai Publication No. 2005-286940, it is known to preparemultiple face patterns in advance and conducting pattern-matching withthe face appearing in an image as a technique for recognizing an objectshape (such as a face) in an image.

SUMMARY

The image processing device according to a first exemplary aspect of thepresent disclosure comprises:

an image acquirer acquiring an image;

a searcher searching for a pixel satisfying a given condition from theimage acquired by the image acquirer;

a first determiner determining whether the pixel satisfying a givencondition is detected during the search by the searcher;

a second determiner determining whether the region comprising a set ofpixels has a particular shape when the first determiner determines thatthe pixel satisfying a given condition is detected; and

a retainer retaining position information showing the position of theregion comprising the set of pixels when the second determinerdetermines that the region has the particular shape.

The image processing method according to a second exemplary aspect ofthe present disclosure comprises:

an image acquisition step of acquiring an image;

a search step of searching for a pixel satisfying a given condition fromthe image acquired in the image acquisition step;

a first determination step of determining whether the pixel satisfying agiven condition is detected during the search in the search step;

a second determination step of determining whether the region comprisinga set of pixels has a particular shape when it is determined in thefirst determination step that the pixel satisfying a given condition isdetected; and

a retention step of retaining position information showing the positionof the region comprising the set of pixels when it is determined in thesecond determination step that the region has the particular shape.

The non-transitory recording medium according to a third exemplaryaspect of the present disclosure records programs that allows a computerto function as:

an image acquirer acquiring an image;

a searcher searching for a pixel satisfying a given condition from theimage acquired by the image acquirer;

a first determiner determining whether the pixel satisfying a givencondition is detected during the search by the searcher;

a second determiner determining whether the region comprising a set ofpixels has a particular shape when the first determiner determines thatthe pixel satisfying a given condition is detected; and

a retainer retaining position information showing the position of theregion comprising the set of pixels when the second determinerdetermines that the region has the particular shape.

BRIEF DESCRIPTION OF THE DRAWINGS

A more complete understanding of this application can be obtained whenthe following detailed description is considered in conjunction with thefollowing drawings, in which:

FIG. 1 is a block diagram showing the hardware configuration of adigital camera according to an embodiment of the present disclosure;

FIG. 2 is a block diagram showing the functional configuration of thedigital camera;

FIG. 3 is an illustration showing an exemplary live view displayed onthe display of the digital camera;

FIG. 4A is an illustration showing one of the steps of the circularshape recognition procedure;

FIG. 4B is an illustration showing one of the steps of the circularshape recognition procedure;

FIG. 4C is an illustration showing one of the steps of the circularshape recognition procedure;

FIG. 4D is an illustration showing one of the steps of the circularshape recognition procedure;

FIG. 4E is an illustration showing one of the steps of the circularshape recognition procedure;

FIG. 4F is an illustration showing one of the steps of the circularshape recognition procedure;

FIG. 5 is a flowchart showing an exemplary flow of the circular shaperecognition procedure;

FIG. 6 is an illustration showing another exemplary live view displayedon the display of the digital camera;

FIG. 7 is an illustration showing a modification of the circular shaperecognition procedure; and

FIG. 8 is an illustration showing an example of the square image shaperecognition procedure.

DETAILED DESCRIPTION

An embodiment of the present disclosure will be described hereafterbased on the drawings. In this embodiment, a digital camera 100 executesthe shape recognition procedure by way of example.

As shown in FIG. 1, the digital camera 100 is an imaging devicecomprising an image capturer 110, an image processor 120, and aninterface 130.

The image capturer 110 comprises an optical device 111 and an imagesensor 112 and conducts the image capture operation of the digitalcamera 100.

The optical device 111 comprises a lens, diaphragm, shutter, and thelike. The optical device 111 collects the incident light and adjusts theoptical elements such as the field angle and focal point.

The image sensor 112 comprises a CCD (charge coupled device), CMOS(complementary metal oxide semiconductor), or the like. The image sensor112 generates electric signals according to the incident light collectedby the optical device 111. The image sensor 112 outputs the generatedelectric signals as analog signals.

The image processor 120 processes the electric signals generated in theimage capture operation by the image capturer 110, then generatesdigital data showing the captured image. Furthermore, the imageprocessor 120 conducts image processing on the captured image. The imageprocessor 120 comprises a controller 121, an integrated circuit 122, astorage 123, and an external storage 124.

The controller 121 comprises a processor such as a CPU (centralprocessing unit) and a main storage such as a RAM (random accessmemory). The controller 121 operates according to the programs stored inthe storage 123 described later to realize the functions necessary forthe operation of the digital camera 100.

The integrated circuit 122 comprises an ADC (analog-to-digitalconverter), buffer memory, image processing processor (so-called imageprocessing engine), YUV image generator, and the like. The ADC convertsthe analog electric signals output from the image sensor 112 to digitalsignals and stores the digital signals in the buffer memory. Then, theimage processing engine generates digital data showing the capturedimage based on the buffered digital signals. The YUV image generatorconverts the generated digital data to a YUV (luminance signal (Y),difference between luminance signal and blue component (U), anddifference between luminance signal and red component (V)) image.

The storage 123 comprises a nonvolatile memory such as a ROM (read onlymemory).

The storage 123 stores programs necessary for the operation of thedigital camera 100 and the like. In this embodiment, the storage 123stores programs read by the controller 121, data showing thresholds usedin the shape recognition procedure described later, and the like.

The external storage 124 comprises a nonvolatile memory detachable tothe digital camera 100 such as a SD (secure digital) card. Imagescaptured by the digital camera 100 are stored in the external storage124.

The interface 130 is a structure regarding interface to the user of thedigital camera 100 or to an external device, and comprises a display131, an external interface 132, and an operation unit 133.

The display 131 comprises a liquid crystal display, organic EL(electroluminescence) display, or the like. The display 131displays/outputs various screens necessary for operating the digitalcamera 100, a live view showing the image captured by the digital camera100 in real time, and captured images. After operating the operationunit 133 of the digital camera 100, the user can view an imagecorresponding to the operation on the display 131.

The external interface 132 comprises a USB (universal serial bus)connector, video output terminals, or the like. The external interface132 outputs captured images to a PC, or an external device, and/ordisplays/outputs captured images on an external monitor via a cable.

The operation unit 133 comprises various buttons. Various buttonsinclude, for example, a shutter button for instructing the captureoperation, a mode button for selecting the operation mode of the digitalcamera 100, and function buttons for various settings. Furthermore, themode button includes, for example, a shape recognition mode button forstarting the shape recognition procedure (for example, a button forswitching to the shape recognition mode to recognize a tag in the formof a circular image).

In this embodiment, the controller 121 executes programs stored in thestorage 123 so as to realize the functions of the components regardingthe shape recognition procedure shown in FIG. 2. Functionally, as shownin FIG. 2, a binary processor 150, a searcher 160, a determiner 170, anda retainer 180 are provided. In this embodiment, the shape recognitionof a circular image will be described by way of example.

The binary processor 150 binarizes a live view image using thresholds ofparameters such as luminance and chrominance. Here, in this embodiment,the luminance defines the degree of brilliance of an image and thechrominance defines the degree of vividness of an image. The luminanceand chrominance have the minimum value of 0 and the maximum value of255. An image changes from dark to bright as the luminance changes fromthe minimum value to the maximum value. An image changes from achromaticto chromatic as the chrominance changes from the minimum value to themaximum value.

Here, as the user presses down the shape recognition mode button duringthe live view mode, the binary processor 150 binarizes the imageappearing on the display 131 in FIG. 3, for example. The displayed imagein FIG. 3 contains, for example, a circular shape marker for visiblelight communication (also called an ID tag) 141 emitting light thatperiodically changes in color within a given luminance range, a lightsource 142 simply emitting light, and an object image 143. In thisembodiment, the binary processor 150 binarizes the image based on thethresholds of the luminance and chrominance stored in the storage 123,and stores in the storage 123 a binary image comprising valid pixels of0xFF where the luminance and chrominance are equal to or higher than thethresholds and invalid pixels of 0x00 where the luminance andchrominance are lower than the thresholds. With this binarization, a24-bit color image is turned into a 1-bit monochrome image.

Incidentally, in consideration for the case in which the shaperecognition target circle is in a chromatic color, the luminance andchrominance thresholds are set to thresholds with which any color (suchas red, blue, yellow) can be turned into a valid pixel in order torecognize the marker 141. In this embodiment, the luminance andchrominance thresholds are set to 120 and 150, respectively, by way ofexample.

A binary image shown in FIG. 4A is obtained from the image in FIG. 3through the above-described binarization by the binary processor 150.This binary image shows that the object image 143 and background in theimage before the binarization were lower than the thresholds and thenturned into invalid images (=black) and the marker 141 and light source142 were equal to or higher than the thresholds and then turned intovalid pixels (=white).

Returning to FIG. 2, the searcher 160 searches for a valid pixel that isa pixel satisfying a given condition from the binary image. Morespecifically, as shown in FIG. 4B, the searcher 160 searches for a validpixel by sequentially scanning the binary image on a pixel column basisline by line from the top left corner of the binary image.

Then, the determiner 170 determines whether a valid pixel is detectedwhile the searcher 160 searches for a valid pixel. More specifically,the determiner 170 detects a valid pixel during the search bydetermining whether there is a change of the binary value (0x00 or 0xFF)from 0x00 indicating an invalid pixel to 0xFF indicating a valid pixel.In FIG. 4B, the determiner 170 has detected a valid pixel during thesearch on the fourth line.

Then, if a valid pixel is detected, the determiner 170 determineswhether the region comprising a set of valid pixels is in the shape ofthe visible light communication marker, namely a circle. Morespecifically, the determiner 170 obtains, as shown in FIG. 4C, thelength of valid pixels in the vertical direction on the assumption thatthe valid pixel is at the upper end of the detected marker 141. In orderto do that, the determiner 170 counts the number of valid pixelssuccessively present in the vertical direction to obtain one length ofthe region comprising a set of valid pixels. Then, assuming that theobtained length in the vertical direction is the diameter, thedeterminer 170 obtains the radiuses in the vertical direction of atentative circle.

Then, the determiner 170 obtains, as shown in FIG. 4D, the right andleft radiuses in the horizontal direction from the center of theobtained diameter. In order to do that, the determiner 170 similarlycounts the number of right and left valid pixels in the horizontaldirection to obtain the radiuses in the horizontal direction. Then, thedeterminer 170 determines whether the region comprising the set of validpixels is nearly circle based on the obtained radiuses in the verticaland horizontal directions. For example, the region is determined to benot circle if the radiuses in the vertical direction and the radiuses inthe horizontal direction are different from more than given pixels.Alternatively, the region can be determined to be not circle if thediameter in the vertical direction and the diameter in the horizontaldirection are different from more than given pixels, or if the right andleft radiuses in the horizontal direction are unbalanced (for example,one of the right and left radiuses in the horizontal direction is longerthan the other by given pixels or more). The above given pixels can beset on an arbitrary basis according to the accuracy of detection.

Here, even if the determiner 170 determines that the region is nearlycircle based on the obtained lengths of the diameters or radiuses, anellipse may be contained because of significantly mismatcheddiameters/radiuses. Then, from the viewpoint of improving thereliability and accuracy, the determiner 170 further determines whetherthe region comprising the set of valid pixels is circle based on thearea of the region.

More specifically, as shown in FIG. 4E, the determiner 170 sets acircumscribed quadrangle circumscribing the circular region. Thedeterminer 170 scans the set circumscribed quadrangle and counts thenumber of invalid pixels and number of valid pixels. Then, thedeterminer 170 assumes that the total pixel number, that is invalidpixel number and valid pixel number, represents the area of thecircumscribed quadrangle and the number of valid pixels represents thearea of the circle. Then, the determiner 170 obtains the area ratio fromthe area of the circumscribed quadrangle and the area of the circle anddetermines whether the region is circle based on the obtained arearatio. Upon this determination, the ordinary area ratio of a circle toits circumscribed quadrangle is used for the above determination.

For obtaining the ordinary area ratio, first, the area of a circlehaving a radius of r is πr² and the area of the circumscribed quadrangleis 2r×2r=4r². Form these areas, the ordinary area ratio is πr²/4r²=79%(rounded off to unit). This ordinary area ratio is used as theprescribed area ratio and compared with the area ratio obtained by thedeterminer 170 to determine whether the region is circle. Also upon thiscomparison, it is possible to require, for example, perfect match, or toset an error range of 79%±a given % and determine whether the ratio iswithin the error range so as to determine whether the region is circle.

Then, if the determiner 170 determines that the region is circle, theretainer 180 retains position information showing the position of theregion comprising the set of valid pixels and determined to be circle.More specifically, the retainer 180 retains in the storage 123 thecoordinates and the length of the radius of the circle as the positioninformation. The coordinates can be the coordinates (x, y) of all validpixels constituting the circle in which x refers to the horizontaldirection and y refers to the vertical direction with the origin at thetop left corner of the binary image or the coordinates of the validpixels constituting the circumference.

Then, as shown in FIG. 4F, the determiner 170 rewrites the circularregion comprising the set of valid pixels (corresponding to the marker141) with invalid pixels as already detected pixels so that this regionwill not be scanned again. Then, as shown in FIG. 4F, the searcher 160restarts the search for a valid pixel except for the circular region.

The functions regarding the circular shape recognition procedurerealized by the controller 121 are described above.

The flow of the circular shape recognition procedure will be describedhereafter with reference to FIG. 5. The circular shape recognitionprocedure in FIG. 5 starts when the user presses down the shaperecognition mode button during the live view mode. Then, the controller121 reads threshold data necessary for the circular shape recognitionprocedure along with programs regarding this procedure. The controller121 loads the read programs and data on its own RAM and executes thefollowing procedure by means of the functions.

First, the binary processor 150 executes binarization (Step S11). Morespecifically, the binary processor 150 binarizes the live view imageusing the thresholds of parameters such as the luminance and chrominanceas described above (see FIG. 4A).

Then, the determiner 170 detects a valid pixel (Step S12). Morespecifically, the determiner 170 detects a valid pixel while thesearcher 160 searches for a valid pixel corresponding to the marker 141(see FIG. 4B). Incidentally, the circular shape recognition procedureends if the determiner 170 cannot detect any valid pixel in all pixelsof the binary image.

Then, the determiner 170 obtains the radiuses in the vertical directionof a tentative circle (Step S13). More specifically, the determiner 170obtains the length of valid pixels in the vertical direction on theassumption that the detected valid pixel is situated at the upper end ofthe circle and obtains the radiuses in the vertical direction of thetentative circle using the obtained length in the vertical direction asthe diameter (see FIG. 4C).

Then, the determiner 170 obtains the radiuses in the horizontaldirection of the tentative circle (Step S14). More specifically, thedeterminer 170 counts the numbers of right and lefts valid pixels in thehorizontal direction to obtain the radiuses in the horizontal direction(see FIG. 4D).

Then, the determiner 170 determines whether the radiuses obtained in theSteps S13 and S14 are different from more than given pixels (Step S15).Here, the radiuses in the vertical direction in the Step S13 are samelength because they are obtained by dividing the diameter in thevertical direction into two. On the other hand, the right and leftradiuses in the horizontal direction are obtained by counting the numberof valid pixels from the center of the tentative circle, whereby thereis a possibility that the right and left radiuses are different. Then,the determiner 170 determines whether the right and left radiuses in thehorizontal direction are different from more than given pixels withrespect to the radiuses in the vertical direction in the Step S15.

Here, if neither of the radiuses in the horizontal direction isdifferent from more than given pixels with respect to the radiuses inthe vertical direction (Step S15; No), the determiner 170 determinesthat the region comprising the set of valid pixels is nearly circle andproceeds to Step S16. On the other hand, if at least one of the rightand left radiuses in the horizontal direction is different from morethan given pixels with respect to the radiuses in the vertical direction(Step S15; Yes) (in other words (1) if one radius in the horizontaldirection is different with respect to the radiuses in the verticaldirection and (2) if both radiuses in the horizontal direction aredifferent with respect to the radiuses in the vertical direction), thedeterminer 170 determines that the region comprising the set of validpixels is not circle and the procedure ends.

If the region comprising the set of valid pixels is nearly circle, thedeterminer 170 sets a circumscribed quadrangle circumscribing the circlein Step S16 (see FIG. 4E).

Then, the determiner 170 obtains the area ratio from the area of thecircumscribed quadrangle and the area of the circle (Step S17). Morespecifically, the determiner 170 scans the circumscribed quadrangle, andobtains the area ratio on the assumption that the total pixel number,that is invalid pixel number and valid pixel number, represents the areaof the circumscribed quadrangle and the number of valid pixelsrepresents the area of the circle.

Then, the determiner 170 determines whether the area ratio obtained inthe Step S17 is within a prescribed area ratio error range (Step S18).More specifically, the determiner 170 determines whether the area ratioobtained in the Step S17 is within a given error range from 79%, whichis the prescribed area ratio.

Here, if it is not within a given error range (Step S18: No), thedeterminer 170 determines that the shape assumed to be nearly circle inthe Step S15 is not a circle and the procedure ends.

On the other hand, if it is within a given error range (Step S18: Yes),the determiner 170 determines that the shape assumed to be nearly circlein the Step S15 is a circle and the retainer 180 retains the positioninformation of the circle (Step S19). More specifically, the retainer180 retains in the storage 123 the coordinates and the length of theradiuses of the circle that are position information showing theposition of the region comprising the set of valid pixels determined tobe circle.

Then, the determiner 170 rewrites the circular region comprising the setof valid pixels with invalid pixels (Step S20) and the procedure ends.After this rewriting, the searcher 160 restarts the search for a validpixel except for the circular region (see FIG. 4F), and the processingof the Steps S12 to S20 is repeated until the search for a valid pixelis completed on all pixels of the binary image.

On the other hand, if the region comprising the set of valid pixels isdetermined to be not circle in the Step S15 or S18, the searcher 160restarts the search for a valid pixel except for the region determinedto be not circle, and the processing of the Steps S12 to S20 is repeateduntil the search for a valid pixel is completed on all pixels of thebinary image. Incidentally, when the searcher 160 restarts the search,the region determined to be not circle can be rewritten to invalidpixels.

In the circular shape recognition procedure of FIG. 5, the controller121 of the digital camera 100 realizes the functions of the binaryprocessor 150, searcher 160, determiner 170, and retainer 180, wherebyit is possible to turn a target image of the shape recognition procedureinto a binary image, and recognize the shape in the image using a simpletechnique based on the area ratio. Thus, the processing load is low andthe processing time is short. Hence, the shape in an image can berecognized at a high speed.

A more specific exemplary application will be described using FIG. 6. Inthis figure, another user appears in the live view displayed on thedisplay 131. This another user is holding a terminal, on the display ofwhich a circle changing in color at fixed time intervals (a visiblelight communication marker 141) is displayed. In visible lightcommunication, recognizing a circular image changing in color at fixedtime intervals and in some pattern (for example, in the order of red,blue, and yellow) (namely a circular image regularly changing inchrominance), the digital camera 100 can receive information associatedwith the pattern. It is preferable in such visible light communicationthat the circular image appearing on the display of the terminal isrecognized quickly so that the user is not kept waiting.

In the above case, as the user presses down, for example, the visiblelight mode button for starting visible light communication while anotheruser appears in the live view, the circular image shape recognition canbe executed at a high speed by executing the above-described circularshape recognition procedure. Incidentally, another known technique isused to recognize the color pattern of the circular image.

Furthermore, another user in FIG. 6 may move during visible lightcommunication and then it is necessary to track the circle. The circularshape recognition procedure of this embodiment can repeatedly detect thecircular image at a high speed, whereby the accuracy of tracking isimproved.

Modified Embodiment

An embodiment is described above. Needless to say, the specificconfiguration of the digital camera 100 and the details of the circularshape recognition procedure shown in FIGS. 4A to 4F and FIG. 5 are notconfined to those described in the above-described embodiment.

For example, in the above-described embodiment, it is determined in thecircular shape recognition procedure of FIG. 5 whether the area ratioobtained in the Step S18 is within a prescribed area ratio error rangeso as to determine whether the region is circle. This is notrestrictive. For example, it is possible to determine whether the imageis circle by dividing the circumscribed quadrangle into quarters,obtaining their area ratios, and determining whether the obtained arearatios are each 20% (the value obtained by rounding off one quarter of79%, which is the prescribed area ratio, to unit). In this way, theaccuracy of detecting a circle can be improved. Incidentally, it ispossible to allow for a given error to the value of one quarter of theprescribed area ratio. Furthermore, the number of portions thecircumscribed quadrangle is divided into can be determined on anarbitrary basis depending on the accuracy.

Furthermore, in the above-described embodiment, it is determined in thestep S15 of the shape recognition procedure of FIG. 5 whether theradiuses in the vertical direction and radiuses in the horizontaldirection of a tentative circle are different from more than givenpixels to determine whether the region is nearly circle. This is notrestrictive. For example, in case where detection of a highly accuratecircular shape is not required, the procedure can end at the Step S15.In such a case, it is determined in the Step S15 whether the region hasa circle-like shape. In this way, the processing of the Steps S16 to S20can be eliminated, whereby the shape recognition procedure can beexecuted at a further higher speed.

Furthermore, in the above-described embodiment, if the region isdetermined to be circle after the circular shape recognition procedureof FIG. 5, the search for a valid pixel is executed except for thecircular region. This is not restrictive. For example, if the region isdetermined to be circle, as shown in FIG. 7, the search for a validpixel can be executed except for the region of the circumscribedquadrangle. In this way, it is possible to reduce the scanning range andexecute the search for remaining valid pixels at a high speed.

Incidentally, in the above explanation, the search is executed exceptfor the region of the circle or circumscribed quadrangle after theregion is determined to be circle. However, this does not means thatrescanning the region where the circle or circumscribed quadrangle waspresent is ruled out.

Furthermore, in the above-described embodiment, the shape recognitionprocedure on a circular image is described. This is not restrictive. Forexample, the shape recognition procedure on a square as another shapecan be executed. In such a case, as shown in FIG. 8, upon detection of avalid pixel, the number of valid pixels in the vertical direction fromthe detected point is counted to obtain the length of one side, and thelength of another side in the horizontal direction is obtained. It isdetermined whether the lengths of the two sides are nearly equal basedon the balance between the obtained length of one side and the obtainedlength of the other side (for example, whether they are different bygiven pixels or more). If the lengths of the two sides are neatly equal,a tentative square is assumed and the area of the tentative squareobtained by counting the number of valid pixels is compared with thearea of the square obtained by the length of a side×2 to determinewhether the region is square.

Furthermore, in the above-described embodiment, the explanation is madeon the assumption of a YUV color space. This is not restrictive. Forexample, a RGB color space can be used. In such a case, the brightnessis used instead of the luminance as a parameter of which a threshold isused in the binarization.

Furthermore, in the above-described embodiment, the explanation is madeon the assumption of the digital camera 100. This is not restrictive.For example, a portable terminal (such as a smart phone) can comprisethe image processor 120 shown in FIG. 1 and execute the above-describedcircular shape recognition procedure. In such a case, if the terminalheld by another user shown in FIG. 6 is a portable terminal, the shaperecognition procedure is applicable to visible light communicationbetween the portable terminals. For example, information associated withthe color pattern of a circle (the another user's personal information(such as telephone number and address) or a message to transmit) can bereceived by the portable terminal held by the user.

Furthermore, the shape recognition procedure of the image processor 120of the present disclosure can be realized by a conventional computersuch as a PC (personal computer).

More specifically, in the above-described embodiment, the explanation ismade on the assumption that the programs for realizing the functionsregarding the shape recognition procedure are stored in the storage 123in advance. However, the programs for realizing the functions of thecomponents in FIG. 2 can be stored and distributed on a non-transitorynon-transitory computer readable recording medium such as a flexibledisc, CD-ROM (compact disc read only memory), DVD (digital versatiledisk), and MO (magneto-optical disk) and installed on a computer toconfigure a computer realizing the above-described functions of thecomponents.

Furthermore, the programs can be stored in a disc device of a serverunit on a communication network such as the Internet, whereby, forexample, a computer can download the programs.

An embodiment of the present disclosure is described above. Theembodiment is given by way of example and does not confine the technicalscope of the present disclosure. The present disclosure can be realizedin various other embodiments, and various modifications includingomission and replacement can be made without departing from the gist ofthe present disclosure. Such embodiments and modifications are includedin the disclosure described in the scope of the claims and the scopeequivalent thereto.

What is claimed is:
 1. An image processing device, comprising: an imageacquirer acquiring an image; a searcher searching for a pixel satisfyinga given condition from the image acquired by the image acquirer; a firstdeterminer determining whether the pixel satisfying a given condition isdetected during the search by the searcher; a second determinerdetermining whether the region comprising a set of pixels has aparticular shape when the first determiner determines that the pixelsatisfying a given condition is detected; and a retainer retainingposition information showing the position of the region comprising theset of pixels when the second determiner determines that the region hasthe particular shape.
 2. The image processing device according to claim1, wherein the searcher restarts the search except for the regioncomprising the set of pixels after the retainer retains the positioninformation.
 3. The image processing device according to claim 1,wherein the second determiner obtains a length of the region in onedirection by counting a number of pixels successively present in a givendirection from the pixel satisfying a given condition under the samecondition, then determines whether the region has a particular shape bydetermining whether the obtained length satisfies a particular conditionwith respect to a length of the region in another direction.
 4. Theimage processing device according to claim 3, wherein the anotherdirection is a direction perpendicular to the center of the onedirection, and the particular condition is that the difference betweenthe length in the one direction and the length in the another directionis within a given difference.
 5. The image processing device accordingto claim 1, wherein the image acquirer successively acquires images, andthe region having a particular shape is a region where at least achrominance changes regularly in the successively acquired images.
 6. Animage processing method, comprising: an image acquisition step ofacquiring an image; a search step of searching for a pixel satisfying agiven condition from the image acquired in the image acquisition step; afirst determination step of determining whether the pixel satisfying agiven condition is detected during the search in the search step; asecond determination step of determining whether the region comprising aset of pixels has a particular shape when it is determined in the firstdetermination step that the pixel satisfying a given condition isdetected; and a retention step of retaining position information showingthe position of the region comprising the set of pixels when it isdetermined in the second determination step that the region has theparticular shape.
 7. A non-transitory recording medium on which programsare recorded, the programs allowing a computer to function as: an imageacquirer acquiring an image; a searcher searching for a pixel satisfyinga given condition from the image acquired by the image acquirer; a firstdeterminer determining whether the pixel satisfying a given condition isdetected during the search by the searcher; a second determinerdetermining whether the region comprising a set of pixels has aparticular shape when the first determiner determines that the pixelsatisfying a given condition is detected; and a retainer retainingposition information showing the position of the region comprising theset of pixels when the second determiner determines that the region hasthe particular shape.